<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('questions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('pm')->notNull()->default('')->comment('提问的PM');
            $table->string('project')->notNull()->default('')->comment('项目名称');
            $table->string('type')->notNull()->default('')->comment('分类');
            $table->text('desc')->comment('描述');
            $table->text('picture')->comment('问题贴图');
            $table->text('document')->comment('问题文件');
            $table->string('name')->notNull()->default('')->comment('提问者名称');
            $table->string('card_number')->notNull()->default('')->comment('提问者学号');
            $table->integer('school_id')->notNull()->default(0)->comment('主体id');

            $table->text('reason')->comment('原因');
            $table->text('method')->comment('解决方法和经验');
            $table->text('content')->comment('备注');
            $table->integer('status')->notNull()->default(0)->comment('解决状态 0:创建 1:已分配 2:已解决');
            $table->integer('author_id')->notNull()->default(0)->comment('管理员id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('questions');
    }
}
